<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="author" content="esy">
    
    <meta name="description" content="esy">
    
    
    
    
    
    
    <title>python_Matplotlib | ESY</title>
    <link href="https://esyyes.github.io" rel="prefetch" />

    
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/aos.css">
<link rel="stylesheet" href="/css/style.css">

    
<script src="/js/jquery.min.js"></script>

    
<script src="/js/bootstrap.min.js"></script>

    
<script src="/js/aos.js"></script>

    
<script src="/js/highslide/highslide-full.min.js"></script>

    
<link rel="stylesheet" href="/js/highslide/highslide.css">

    <style type="text/css">
        @media (max-width: 768px) {
            body {
                background-color: #f0f0f0;
                background: url('/imgs/xsbg.gif');
                background-attachment: fixed;
            }
        }
    </style>
    
    <!--<script type="text/javascript">
      if (document.images) {
        var avatar = new Image();
        avatar.src = '/imgs/avatar.jpg'
        var previews = 'preview1.jpg,preview2.jpg,preview3.jpg,preview4.jpg'.split(',')
        var previewsPreLoad = []
        for(var i = 0; i < length; i++) {
          previewsPreLoad.push(new Image())
          previewsPreLoad[previewsPreLoad.length - 1].src = '/imgs/preview' + previews[i]
        }
      }
    </script>-->
<meta name="generator" content="Hexo 5.2.0"></head>
<body>
    <!-- 背景轮播图功能 -->
    <section class="hidden-xs">
    <ul class="cb-slideshow">
        <li><span>天若</span></li>
        <li><span>有情</span></li>
        <li><span>天亦老</span></li>
        <li><span>我为</span></li>
        <li><span>长者</span></li>
        <li><span>续一秒</span></li>
    </ul>
</section>
    <!-- 欧尼酱功能, 谁用谁知道 -->
    
    <div class="gal-menu gal-dropdown">
    <div class="circle" id="gal">
        <div class="ring">
            <a href="https://esyyes.github.io" class="menuItem" style="left: 50%; top: 15%;">首页</a>
            
            <a class="menuItem" style="left: 80.3109%; top: 32.5%;">下一页</a>
            
            <a href="/archives" class="menuItem" style="left: 80.3109%; top: 67.5%;">归档</a>
            <a href="/about" class="menuItem" style="left: 50%; top: 85%;">关于</a>
            <a href="/message" class="menuItem" style="left: 19.6891%; top: 67.5%;">留言板</a>

            
            <a class="menuItem" style="left: 19.6891%; top: 32.5%;">上一页</a>
            
        </div>
        <audio id="audio" src="/imgs/oni.mp3"></audio>
    </div>
</div>
    
    <header class="navbar navbar-inverse" id="gal-header">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target=".bs-navbar-collapse"
                    aria-expanded="false">
                <span class="fa fa-lg fa-reorder"></span>
            </button>
            <a href="https://esyyes.github.io">
                
                <style>
                    #gal-header .navbar-brand {
                        height: 54px;
                        line-height: 24px;
                        font-size: 28px;
                        opacity: 1;
                        background-color: rgba(0,0,0,0);
                        text-shadow: 0 0 5px #fff,0 0 10px #fff,0 0 15px #fff,0 0 20px #228DFF,0 0 35px #228DFF,0 0 40px #228DFF,0 0 50px #228DFF,0 0 75px #228DFF;
                    }
                </style>
                <!-- 这里使用文字(navbar_text or config.title) -->
                <div class="navbar-brand">ESY</div>
                
            </a>
        </div>
        <div class="collapse navbar-collapse bs-navbar-collapse">
            <ul class="nav navbar-nav" id="menu-gal">
                
                
                <li class="">
                    <a href="/">
                        <i class="fa fa-home"></i>首页
                    </a>
                </li>
                
                
                
                <li class="">
                    <a href="/archives">
                        <i class="fa fa-archive"></i>归档
                    </a>
                </li>
                
                
                
                
                <li class="dropdown">
                    <!-- TODO 添加hover dropdown效果 -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" data-hover="dropdown">
                        <i class="fa fa-list"></i>分类
                    </a>
                    <ul class="dropdown-menu">
                        
                        
                        <li>
                            <a href="/categories/py-study/">py_study</a>
                        </li>
                        
                        <li>
                            <a href="/categories/nlp/">nlp</a>
                        </li>
                        
                        <li>
                            <a href="/categories/Graduation-work/">Graduation work</a>
                        </li>
                        
                        <li>
                            <a href="/categories/work/">work</a>
                        </li>
                        
                        <li>
                            <a href="/categories/hexo/">hexo</a>
                        </li>
                        
                        <li>
                            <a href="/categories/hexo%E5%AE%8C%E5%96%84/">-hexo完善</a>
                        </li>
                        
                        
                        <li>
                            <a href="/categories">...</a>
                        </li>
                        
                        
                    </ul>
                </li>
                
                
                
                
                
                <li class="dropdown">
                    <!-- TODO 添加hover dropdown效果 -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" data-hover="dropdown">
                        <i class="fa fa-tags"></i>标签
                    </a>
                    <ul class="dropdown-menu">
                        
                        
                        <li>
                            <a href="/tags/py-study/">py_study</a>
                        </li>
                        
                        <li>
                            <a href="/tags/nlp/">nlp</a>
                        </li>
                        
                        <li>
                            <a href="/tags/Graduation-work/">Graduation work</a>
                        </li>
                        
                        <li>
                            <a href="/tags/work/">work</a>
                        </li>
                        
                        <li>
                            <a href="/tags/hexo/">hexo</a>
                        </li>
                        
                        <li>
                            <a href="/tags/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/">-个人博客搭建</a>
                        </li>
                        
                        
                        <li>
                            <a href="/tags">...</a>
                        </li>
                        
                        
                    </ul>
                </li>
                
                
                
                
                <li class="">
                    <a href="/about">
                        <i class="fa fa-user"></i>关于我
                    </a>
                </li>
                
                
            </ul>
        </div>
    </div>
</header>
    <div id="gal-body">
        <div class="container">
            <div class="row">
                <div class="col-md-8 gal-right" id="mainstay">
                    
<article class="article well article-body" id="article">
    <div class="breadcrumb">
        <i class="fa fa-home"></i>
        <a href="https://esyyes.github.io">ESY</a>
        >
        <span>python_Matplotlib</span>
    </div>
    <!-- 大型设备详细文章 -->
    <div class="hidden-xs">
        <div class="title-article">
            <h1>
                <a href="/2020/03/19/python%20work/python-Matplotlib/">python_Matplotlib</a>
            </h1>
        </div>
        <div class="tag-article">
            
            <span class="label label-gal">
                <i class="fa fa-calendar"></i> 2020-03-19
            </span>
            
        </div>
    </div>
    <!-- 小型设备详细文章 -->
    <div class="visible-xs">
        <center>
            <div class="title-article">
                <h4>
                    <a href="/2020/03/19/python%20work/python-Matplotlib/">python_Matplotlib</a>
                </h4>
            </div>
            <p>
                <i class="fa fa-calendar"></i> 2020-03-19
            </p>
            <p>
                
                
            </p>
        </center>
    </div>
    <div class="content-article">
        <h1 id="python-Matplotlib"><a href="#python-Matplotlib" class="headerlink" title="python_Matplotlib"></a>python_Matplotlib</h1><p>参考这个即可</p>
<p><a target="_blank" rel="noopener" href="https://www.jb51.net/article/168302.htm">https://www.jb51.net/article/168302.htm</a></p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> matplotlib <span class="keyword">import</span> pyplot <span class="keyword">as</span> plt</span><br></pre></td></tr></table></figure>

<p>横纵坐标的确定，以绘制特征选择曲线为例。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np </span><br><span class="line"><span class="keyword">from</span> matplotlib <span class="keyword">import</span> pyplot <span class="keyword">as</span> plt</span><br><span class="line">x = np.arange(<span class="number">1</span>, <span class="number">25</span>)</span><br><span class="line">y为N123RW,DLRW,SRW</span><br></pre></td></tr></table></figure>

<p>绘制最简单的图像</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">x = np.arange(<span class="number">1</span>, <span class="number">25</span>)</span><br><span class="line">y1 = N123RW</span><br><span class="line">y2 = DLRW</span><br><span class="line">y3 = SRW</span><br></pre></td></tr></table></figure>

<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">plt.plot(x,y1) </span><br><span class="line">plt.xlabel(<span class="string">&quot;Characteristic number&quot;</span>) </span><br><span class="line">plt.ylabel(<span class="string">&quot;Accuracy of RF&quot;</span>)</span><br><span class="line">plt.title(<span class="string">&quot;Feature elimination based on DBT and RFE&quot;</span>)</span><br><span class="line">plt.show()</span><br></pre></td></tr></table></figure>

<p><img src="H:\myboke\mybike\source\images\test1.png" alt="image-20200319162254065"></p>
<h2 id="对点进行标记"><a href="#对点进行标记" class="headerlink" title="对点进行标记"></a>对点进行标记</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">plt.plot(x,y1,<span class="string">&quot;*r&quot;</span>)</span><br><span class="line"><span class="comment"># 只有点</span></span><br><span class="line">plt.plot(x,y1,<span class="string">&quot;*r--&quot;</span>)</span><br><span class="line"><span class="comment"># 带虚线的点</span></span><br></pre></td></tr></table></figure>

<p><img src="H:\myboke\mybike\source\images\test2.png" alt="image-20200319162723556"></p>
<table>
<thead>
<tr>
<th><code>&#39;-&#39;</code></th>
<th>实线样式</th>
</tr>
</thead>
<tbody><tr>
<td><code>&#39;--&#39;</code></td>
<td>短横线样式</td>
</tr>
<tr>
<td><code>&#39;-.&#39;</code></td>
<td>点划线样式</td>
</tr>
<tr>
<td><code>&#39;:&#39;</code></td>
<td>虚线样式</td>
</tr>
<tr>
<td><code>&#39;.&#39;</code></td>
<td>点标记</td>
</tr>
<tr>
<td><code>&#39;,&#39;</code></td>
<td>像素标记</td>
</tr>
<tr>
<td><code>&#39;o&#39;</code></td>
<td>圆标记</td>
</tr>
<tr>
<td><code>&#39;v&#39;</code></td>
<td>倒三角标记</td>
</tr>
<tr>
<td><code>&#39;^&#39;</code></td>
<td>正三角标记</td>
</tr>
<tr>
<td><code>&#39;&lt;&#39;</code></td>
<td>左三角标记</td>
</tr>
<tr>
<td><code>&#39;&gt;&#39;</code></td>
<td>右三角标记</td>
</tr>
<tr>
<td><code>&#39;1&#39;</code></td>
<td>下箭头标记</td>
</tr>
<tr>
<td><code>&#39;2&#39;</code></td>
<td>上箭头标记</td>
</tr>
<tr>
<td><code>&#39;3&#39;</code></td>
<td>左箭头标记</td>
</tr>
<tr>
<td><code>&#39;4&#39;</code></td>
<td>右箭头标记</td>
</tr>
<tr>
<td><code>&#39;s&#39;</code></td>
<td>正方形标记</td>
</tr>
<tr>
<td><code>&#39;p&#39;</code></td>
<td>五边形标记</td>
</tr>
<tr>
<td><code>&#39;*&#39;</code></td>
<td>星形标记</td>
</tr>
<tr>
<td><code>&#39;h&#39;</code></td>
<td>六边形标记 1</td>
</tr>
<tr>
<td><code>&#39;H&#39;</code></td>
<td>六边形标记 2</td>
</tr>
<tr>
<td><code>&#39;+&#39;</code></td>
<td>加号标记</td>
</tr>
<tr>
<td><code>&#39;x&#39;</code></td>
<td>X 标记</td>
</tr>
<tr>
<td><code>&#39;D&#39;</code></td>
<td>菱形标记</td>
</tr>
<tr>
<td><code>&#39;d&#39;</code></td>
<td>窄菱形标记</td>
</tr>
<tr>
<td>`’</td>
<td>‘`</td>
</tr>
<tr>
<td><code>&#39;_&#39;</code></td>
<td>水平线标记</td>
</tr>
</tbody></table>
<table>
<thead>
<tr>
<th align="left">字符</th>
<th align="left">颜色</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><code>&#39;b&#39;</code></td>
<td align="left">蓝色</td>
</tr>
<tr>
<td align="left"><code>&#39;g&#39;</code></td>
<td align="left">绿色</td>
</tr>
<tr>
<td align="left"><code>&#39;r&#39;</code></td>
<td align="left">红色</td>
</tr>
<tr>
<td align="left"><code>&#39;c&#39;</code></td>
<td align="left">青色</td>
</tr>
<tr>
<td align="left"><code>&#39;m&#39;</code></td>
<td align="left">品红色</td>
</tr>
<tr>
<td align="left"><code>&#39;y&#39;</code></td>
<td align="left">黄色</td>
</tr>
<tr>
<td align="left"><code>&#39;k&#39;</code></td>
<td align="left">黑色</td>
</tr>
<tr>
<td align="left"><code>&#39;w&#39;</code></td>
<td align="left">白色</td>
</tr>
</tbody></table>
<h2 id="问题"><a href="#问题" class="headerlink" title="问题"></a>问题</h2><p>图像不清晰，横坐标想用12345-25表示，字体太小</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><span class="line">属性                      值类型</span><br><span class="line">alpha                   浮点值</span><br><span class="line">animated                [<span class="literal">True</span> / <span class="literal">False</span>]</span><br><span class="line">antialiased <span class="keyword">or</span> aa       [<span class="literal">True</span> / <span class="literal">False</span>]</span><br><span class="line">clip_box                matplotlib.transform.Bbox 实例</span><br><span class="line">clip_on                 [<span class="literal">True</span> / <span class="literal">False</span>]</span><br><span class="line">clip_path               Path 实例， Transform，以及Patch实例</span><br><span class="line">color <span class="keyword">or</span> c              任何 matplotlib 颜色</span><br><span class="line">contains                命中测试函数</span><br><span class="line">dash_capstyle           [<span class="string">&#x27;butt&#x27;</span> / <span class="string">&#x27;round&#x27;</span> / <span class="string">&#x27;projecting&#x27;</span>]</span><br><span class="line">dash_joinstyle          [<span class="string">&#x27;miter&#x27;</span> / <span class="string">&#x27;round&#x27;</span> / <span class="string">&#x27;bevel&#x27;</span>]</span><br><span class="line">dashes                  以点为单位的连接/断开墨水序列</span><br><span class="line">data                    (np.array xdata, np.array ydata)</span><br><span class="line">figure                  matplotlib.figure.Figure 实例</span><br><span class="line">label                   任何字符串</span><br><span class="line">linestyle <span class="keyword">or</span> ls         [ <span class="string">&#x27;-&#x27;</span> / <span class="string">&#x27;--&#x27;</span> / <span class="string">&#x27;-.&#x27;</span> / <span class="string">&#x27;:&#x27;</span> / <span class="string">&#x27;steps&#x27;</span> / ...]</span><br><span class="line">linewidth <span class="keyword">or</span> lw         以点为单位的浮点值</span><br><span class="line">lod                     [<span class="literal">True</span> / <span class="literal">False</span>]</span><br><span class="line">marker                  [ <span class="string">&#x27;+&#x27;</span> / <span class="string">&#x27;,&#x27;</span> / <span class="string">&#x27;.&#x27;</span> / <span class="string">&#x27;1&#x27;</span> / <span class="string">&#x27;2&#x27;</span> / <span class="string">&#x27;3&#x27;</span> / <span class="string">&#x27;4&#x27;</span> ]</span><br><span class="line">markeredgecolor <span class="keyword">or</span> mec  任何 matplotlib 颜色</span><br><span class="line">markeredgewidth <span class="keyword">or</span> mew  以点为单位的浮点值</span><br><span class="line">markerfacecolor <span class="keyword">or</span> mfc  任何 matplotlib 颜色</span><br><span class="line">markersize <span class="keyword">or</span> ms        浮点值</span><br><span class="line">markevery               [ <span class="literal">None</span> / 整数值 / (startind, stride) ]</span><br><span class="line">picker                  用于交互式线条选择</span><br><span class="line">pickradius              线条的拾取选择半径</span><br><span class="line">solid_capstyle          [<span class="string">&#x27;butt&#x27;</span> / <span class="string">&#x27;round&#x27;</span> / <span class="string">&#x27;projecting&#x27;</span>]</span><br><span class="line">solid_joinstyle         [<span class="string">&#x27;miter&#x27;</span> / <span class="string">&#x27;round&#x27;</span> / <span class="string">&#x27;bevel&#x27;</span>]</span><br><span class="line">transform               matplotlib.transforms.Transform 实例</span><br><span class="line">visible                 [<span class="literal">True</span> / <span class="literal">False</span>]</span><br><span class="line">xdata                   np.array</span><br><span class="line">ydata                   np.array</span><br><span class="line">zorder                  任何数值</span><br></pre></td></tr></table></figure>

<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 显示中文</span></span><br><span class="line">mpl.rcParams[<span class="string">&#x27;font.sans-serif&#x27;</span>] = [<span class="string">&#x27;FangSong&#x27;</span>] <span class="comment"># 指定默认字体 </span></span><br><span class="line">mpl.rcParams[<span class="string">&#x27;axes.unicode_minus&#x27;</span>] = <span class="literal">False</span> <span class="comment"># 解决保存图像是负号&#x27;-&#x27;显示为方块的问题</span></span><br></pre></td></tr></table></figure>

<table>
<thead>
<tr>
<th>黑体</th>
<th>SimHei</th>
</tr>
</thead>
<tbody><tr>
<td>微软雅黑</td>
<td>Microsoft YaHei</td>
</tr>
<tr>
<td>微软正黑体</td>
<td>Microsoft JhengHei</td>
</tr>
<tr>
<td>新宋体</td>
<td>NSimSun</td>
</tr>
<tr>
<td>新细明体</td>
<td>PMingLiU</td>
</tr>
<tr>
<td>细明体</td>
<td>MingLiU</td>
</tr>
<tr>
<td>标楷体</td>
<td>DFKai-SB</td>
</tr>
<tr>
<td>仿宋</td>
<td>FangSong</td>
</tr>
<tr>
<td>楷体</td>
<td>KaiTi</td>
</tr>
<tr>
<td>仿宋_GB2312</td>
<td>FangSong_GB2312</td>
</tr>
<tr>
<td>楷体_GB2312</td>
<td>KaiTi_GB2312</td>
</tr>
</tbody></table>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#颜色、标记和线型</span></span><br><span class="line">plt.figure()</span><br><span class="line"><span class="comment">##linestyle设置线型，color设置颜色,marker设置设置连接点</span></span><br><span class="line">plt.plot(numpy.random.randn(<span class="number">30</span>).cumsum(),linestyle=<span class="string">&#x27;--&#x27;</span>,color=<span class="string">&#x27;g&#x27;</span>,marker=<span class="string">&#x27;o&#x27;</span>)</span><br></pre></td></tr></table></figure>

<p>参考这个</p>
<p><a target="_blank" rel="noopener" href="https://www.jb51.net/article/168302.htm">https://www.jb51.net/article/168302.htm</a></p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#设置标题、轴标签，刻度以及刻度标签</span></span><br><span class="line">fig = plt.figure()   <span class="comment">#创建figure对象</span></span><br><span class="line">ax = fig.add_subplot(<span class="number">1</span>,<span class="number">1</span>,<span class="number">1</span>)   <span class="comment">#获得Axes对象</span></span><br><span class="line">ax.plot(numpy.random.randn(<span class="number">1000</span>).cumsum()) <span class="comment">#生成随机数</span></span><br><span class="line">ax.set_xticks([<span class="number">0</span>,<span class="number">250</span>,<span class="number">500</span>,<span class="number">750</span>,<span class="number">1000</span>])   <span class="comment">#设置x轴刻度</span></span><br><span class="line">ax.set_yticks([<span class="number">-20</span>,<span class="number">-10</span>,<span class="number">0</span>,<span class="number">10</span>,<span class="number">20</span>])    <span class="comment">#设置y轴刻度</span></span><br><span class="line">ax.set_title(<span class="string">&#x27;My first matplotlib plot&#x27;</span>)  <span class="comment">#设置标题</span></span><br><span class="line">ax.set_xlabel(<span class="string">&#x27;Xtages&#x27;</span>)   <span class="comment">#设置x轴标签</span></span><br><span class="line">ax.set_ylabel(<span class="string">&#x27;Ytages&#x27;</span>)   <span class="comment">#设置y轴标签</span></span><br></pre></td></tr></table></figure>

<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">plt.annotate(<span class="string">&quot;Important value&quot;</span>, (<span class="number">55</span>,<span class="number">20</span>), xycoords=<span class="string">&#x27;data&#x27;</span>,  <span class="comment">#添加注释的方法</span></span><br><span class="line">     xytext=(<span class="number">5</span>, <span class="number">38</span>),</span><br><span class="line">     arrowprops=<span class="built_in">dict</span>(arrowstyle=<span class="string">&#x27;-&gt;&#x27;</span>))</span><br></pre></td></tr></table></figure>

<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 调整图像的大小</span></span><br><span class="line">fig = plt.figure(figsize=(<span class="number">12</span>,<span class="number">6</span>))</span><br><span class="line"><span class="comment">#解决中文显示问题</span></span><br><span class="line">plt.rcParams[<span class="string">&#x27;font.sans-serif&#x27;</span>]=[<span class="string">&#x27;Microsoft YaHei&#x27;</span>]</span><br><span class="line">plt.rcParams[<span class="string">&#x27;axes.unicode_minus&#x27;</span>] = <span class="literal">False</span></span><br><span class="line"><span class="comment"># 标记图的序号</span></span><br><span class="line"><span class="comment"># fig.suptitle(&#x27;1&#x27;) </span></span><br><span class="line"><span class="comment"># 改变横纵坐标</span></span><br><span class="line">plt.xticks(x)</span><br><span class="line"><span class="comment"># 绘制图像，r*--颜色，点的标记，线段模式，label标签的名字，linewidth线的宽度</span></span><br><span class="line">plt.plot(x,y1,<span class="string">&quot;r*--&quot;</span>, label=<span class="string">&#x27;N123RW&#x27;</span>,linewidth=<span class="number">0.25</span> )</span><br><span class="line">plt.plot(x,y2,<span class="string">&quot;ks--&quot;</span>, label=<span class="string">&#x27;DLRW&#x27;</span>,linewidth=<span class="number">0.25</span>)</span><br><span class="line">plt.plot(x,y3,<span class="string">&quot;gp--&quot;</span>, label=<span class="string">&#x27;SRW&#x27;</span>,linewidth=<span class="number">0.25</span>)</span><br><span class="line"><span class="comment"># 显示标签，默认为axis=0左上角</span></span><br><span class="line">plt.legend()</span><br><span class="line"><span class="comment"># fontsize字体大小</span></span><br><span class="line">plt.xlabel(<span class="string">&quot;Characteristic number&quot;</span>, fontsize = <span class="number">15</span>) </span><br><span class="line">plt.xticks(fontsize=<span class="number">10</span>)</span><br><span class="line">plt.ylabel(<span class="string">&quot;Accuracy of RF&quot;</span>, fontsize = <span class="number">15</span>)</span><br><span class="line">plt.yticks(fontsize=<span class="number">10</span>)</span><br><span class="line">plt.title(<span class="string">&quot;Feature elimination based on DBT and RFE&quot;</span>, fontsize = <span class="number">15</span>)</span><br><span class="line">plt.show()</span><br><span class="line">fig.savefig(<span class="string">&#x27;features.png&#x27;</span>,dpi = <span class="number">400</span>,bbox_inches=<span class="string">&#x27;tight&#x27;</span>)</span><br></pre></td></tr></table></figure>


    </div>
</article>


                </div>
                <aside class="col-md-4 gal-left" id="sidebar">
    <!-- 此为sidebar的搜索框, 非搜索结果页面 -->
<aside id="sidebar-search">
    <div class="search hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <form class="form-inline clearfix" id="search-form" method="get"
              action="/search/index.html">
            <input type="text" name="s" class="form-control" id="searchInput" placeholder="搜索文章~" autocomplete="off">
            <button class="btn btn-danger btn-gal" type="submit">
                <i class="fa fa-search"></i>
            </button>
        </form>
    </div>
</aside>
    <aside id="sidebar-author">
    <div class="panel panel-gal" data-aos="flip-right" data-aos-duration="3000">
        <div class="panel-heading" style="text-align: center">
            <i class="fa fa-quote-left"></i>
            esy
            <i class="fa fa-quote-right"></i>
        </div>
        <div class="author-panel text-center">
            <img src="/imgs/avatar.jpg" width="140" height="140"
                 alt="个人头像" class="author-image">
            <p class="author-description"><p>esy</p>
</p>
        </div>
    </div>
</aside>
    
    <aside id="sidebar-recent_comments">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-comments"></i>
            最新评论
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush"></ul>
    </div>
</aside>
    
    <!-- 要配置好leancloud才能开启此小工具 -->
    
    
    <aside id="sidebar-recent_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            近期文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/05/python%20work/%E6%9C%80%E5%B0%8F%E4%BA%8C%E4%B9%98%E6%B3%95/">最小二乘法</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/05/python%20work/%E7%BB%9F%E8%AE%A1%E5%AD%A6%E4%B9%A0-%E7%AC%AC%E4%B8%80%E7%AB%A0/">统计学习--第一章</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/04/python%20work/hello-world/">Hello World</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/03/python%20work/%E5%88%86%E7%B1%BB%E6%A8%A1%E5%9E%8B%E7%9A%84%E8%AF%84%E4%BC%B0%E6%8C%87%E6%A0%87/">分类模型的评估指标</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/10/21/python%20work/10-21-%E7%88%AC%E8%99%AB%E5%9F%BA%E7%A1%80/">10-21 爬虫基础</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/CRF%E7%9A%84%E6%95%B4%E4%BD%93%E6%B5%81%E7%A8%8B%E7%BB%93%E6%9E%9C/">CRF的整体流程结果</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/nlp-crf%E6%A8%A1%E5%9E%8B/">nlp_crf模型</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E9%97%AE%E9%A2%983/">数学建模问题3</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E9%97%AE%E9%A2%982/">数学建模问题2</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E9%97%AE%E9%A2%981/">数学建模问题1</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="sidebar-rand_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            随机文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/02/28/python%20work/2-28%E6%B1%87%E6%8A%A5/">2-28汇报</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/05/26/python%20work/python-%E5%85%A5%E9%97%A8%E5%A4%8D%E4%B9%A0%E4%B9%8B%E6%96%87%E4%BB%B6%E8%AF%BB%E5%8F%96/">python_入门复习之文件读取</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/05/26/python%20work/python-%E5%85%A5%E9%97%A8%E5%A4%8D%E4%B9%A0%E4%B9%8B%E6%A8%A1%E5%9D%97%E5%92%8C%E5%8C%85/">python-入门复习之模块和包</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/08/08/python%20work/q-a%E6%95%B0%E6%8D%AE%E8%A1%A5%E5%85%85/">q&amp;a数据补充</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/12/16/python%20work/%E5%BF%83%E7%8E%87%E5%8F%98%E5%BC%82%E6%80%A7/">心率变异性</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/08/23/python%20work/%E7%89%B9%E5%BE%81%E9%80%89%E6%8B%A9%E7%9A%84%E6%96%B0%E7%90%86%E8%A7%A3%E5%92%8C%E6%9B%B4%E6%94%B9/">特征选择的新理解和更改</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/07/08/python%20work/%E7%8A%B6%E6%80%81%E4%B8%BA3%E6%97%B6%E7%9A%84%E8%AE%BE%E5%AE%9A/">状态为3时的设定</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/08/23/python%20work/%E7%BB%98%E5%88%B6%E7%89%B9%E5%BE%81%E9%80%89%E6%8B%A9%E7%BB%93%E6%9E%9C%E5%9B%BE/">绘制特征选择结果图</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/06/24/python%20work/%E7%BB%98%E5%88%B6%E7%89%B9%E5%BE%81%E9%87%8D%E8%A6%81%E5%BA%A6%E7%AD%9B%E9%80%89%E7%BB%93%E6%9E%9C/">绘制特征重要度筛选结果</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/05/28/python%20work/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E7%89%88%E5%AD%A6%E5%91%98%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/">面向对象版学员管理系统</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="gal-sets">
        <div class="panel panel-gal hidden-xs" data-aos="fade-up" data-aos-duration="2000">
            <ul class="nav nav-pills pills-gal">

                
                <li>
                    <a href="/2020/03/19/python%20work/python-Matplotlib/index.html#sidebar-tags" data-toggle="tab" id="tags-tab">热门标签</a>
                </li>
                
                
                <li>
                    <a href="/2020/03/19/python%20work/python-Matplotlib/index.html#sidebar-friend-links" data-toggle="tab" id="friend-links-tab">友情链接</a>
                </li>
                
                
                <li>
                    <a href="/2020/03/19/python%20work/python-Matplotlib/index.html#sidebar-links" data-toggle="tab" id="links-tab">个人链接</a>
                </li>
                
            </ul>
            <div class="tab-content">
                
                <div class="cloud-tags tab-pane nav bs-sidenav fade" id="sidebar-tags">
    
    <a href="/tags/py-study/" style="font-size: 10.633228784929972px;" class="tag-cloud-link">py_study</a>
    
    <a href="/tags/nlp/" style="font-size: 15.157068141438478px;" class="tag-cloud-link">nlp</a>
    
    <a href="/tags/Graduation-work/" style="font-size: 14.186989505746968px;" class="tag-cloud-link">Graduation work</a>
    
    <a href="/tags/work/" style="font-size: 16.022312196697968px;" class="tag-cloud-link">work</a>
    
    <a href="/tags/hexo/" style="font-size: 18.434865897184px;" class="tag-cloud-link">hexo</a>
    
    <a href="/tags/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" style="font-size: 8.01244494906495px;" class="tag-cloud-link">-个人博客搭建</a>
    
    <a href="/tags/malab-%E6%AF%95%E4%B8%9A/" style="font-size: 15.857128106558369px;" class="tag-cloud-link">-malab -毕业</a>
    
    <a href="/tags/python-%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/" style="font-size: 17.784872245357107px;" class="tag-cloud-link">-python -人工智能</a>
    
    <a href="/tags/python/" style="font-size: 18.421013825235832px;" class="tag-cloud-link">python</a>
    
    <a href="/tags/python/" style="font-size: 17.006592952417126px;" class="tag-cloud-link">-python</a>
    
    <a href="/tags/mathematical-modeling/" style="font-size: 12.16258708420889px;" class="tag-cloud-link">mathematical modeling</a>
    
    <a href="/tags/statistical-learning/" style="font-size: 9.104173984770377px;" class="tag-cloud-link">statistical learning</a>
    
</div>
                
                
                <div class="friend-links tab-pane nav bs-sidenav fade" id="sidebar-friend-links">
    
    <li>
        <a href="http://kdays.net/days/" target="_blank">KDays Forum</a>
    </li>
    
    <li>
        <a href="http://www.gal123.com/" target="_blank">绅士导航♂</a>
    </li>
    
    <li>
        <a href="http://www.moe123.com/" target="_blank">萌导航</a>
    </li>
    
</div>
                
                
                <div class="links tab-pane nav bs-sidenav fade" id="sidebar-links">
    
    <li>
        <a href="https://github.com/ZEROKISEKI/" target="_blank">Github</a>
    </li>
    
    <li>
        <a href="https://coding.net/u/SORA1" target="_blank">Coding</a>
    </li>
    
    <li>
        <a href="https://www.zhihu.com/people/aonosora/activities" target="_blank">知乎</a>
    </li>
    
</div>
                
            </div>
        </div>
    </aside>
    
</aside>
            </div>
        </div>
    </div>
    <footer id="gal-footer">
    <div class="container">
        Copyright © 2018 esy Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>.&nbsp;Theme by <a href="https://github.com/ZEROKISEKI" target="_blank">AONOSORA</a>
    </div>
</footer>

<!-- 回到顶端 -->
<div id="gal-gotop">
    <i class="fa fa-angle-up"></i>
</div>
</body>

<script src="/js/activate-power-mode.js"></script>

<script>

    // 配置highslide
	hs.graphicsDir = '/js/highslide/graphics/'
    hs.outlineType = "rounded-white";
    hs.dimmingOpacity = 0.8;
    hs.outlineWhileAnimating = true;
    hs.showCredits = false;
    hs.captionEval = "this.thumb.alt";
    hs.numberPosition = "caption";
    hs.align = "center";
    hs.transitions = ["expand", "crossfade"];
    hs.lang.number = '共%2张图, 当前是第%1张';
    hs.addSlideshow({
      interval: 5000,
      repeat: true,
      useControls: true,
      fixedControls: "fit",
      overlayOptions: {
        opacity: 0.75,
        position: "bottom center",
        hideOnMouseOut: true
      }
    })

    // 初始化aos
    AOS.init({
      duration: 1000,
      delay: 0,
      easing: 'ease-out-back'
    });

</script>
<script>
	POWERMODE.colorful = 'true';    // make power mode colorful
	POWERMODE.shake = 'true';       // turn off shake
	// TODO 这里根据具体情况修改
	document.body.addEventListener('input', POWERMODE);
</script>
<script>
    window.slideConfig = {
      prefix: '/imgs/slide/background',
      ext: 'jpg',
      maxCount: '6'
    }
</script>

<script src="/js/hs.js"></script>
<script src="/js/blog.js"></script>



<script src="/js/oni.js"></script>




</html>